<template>
  <div class="newsv">
    <h4>疫情新闻</h4>
    <dv-scroll-board :config="config" style="width:100%;height:90%" />
  </div>
</template>

<script>
export default {
  name: "News",
  data() {
    return {
      config: {
        data: [],
        rowNum: 8,
        waitTime: 3000,
        headerBGC: "#072933",
        oddRowBGC: "#030409",
        evenRowBGC: "#030409"
      }
    };
  },
  created() {
    this.formateData(this.newsAll);
  },
  methods: {
    formateData(newsAll) {
      this.config.data = newsAll.map(value => {
        const a = value.title;
        return [a];
      });
    }
  },
  props: {
    newsAll: Array
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.newsv {
  height: 100%;
  padding: 20px;
  color: #cecece;
  box-sizing: border-box;
  text-align: left;
  h4 {
    margin-bottom: 10px;
  }
}
</style>
